<template>
  <div>
    <Table border :columns="columns" :data="recordsList"></Table>
  </div>
</template>

<script>
import { globalUrl } from '@/api/doMain'

export default {
  name: 'Records',
  created () {
    this.queryList()
  },
  data () {
    return {
      columns: [
        {
          title: 'Id',
          key: 'id',
          type: 'selection',
          width: 55
        },
        {
          title: '试卷',
          key: 'paperName'
        },
        {
          title: '学生姓名',
          key: 'userName'
        },
        {
          title: '考试时间',
          key: 'createTime',
          render: (h, params) => {
            return h('div',
              this.dateFormat(params.row.createTime)
            )
          }
        }
      ],
      recordsList: [],  // 记录列表
    }
  },
  methods: {
    queryList () {
      let that = this
      that.http.post(globalUrl + '/record/queryList', { token: window.sessionStorage.getItem('token') }).then(function (response) {
        that.recordsList = response.data.data
      })
    },
  }
}
</script>

<style scoped>

</style>
